<!--用户管理-->
<template>
  <div class="page-container">
    <ex_super_table_page v-bind="option" ref="SuperTablePage">
    </ex_super_table_page>

    <ex_super_dialog_form ref="formDialog" v-bind="dialog" @afterSubmitSuccess="reload()">
    </ex_super_dialog_form>



  </div>
</template>
<script>

import FmsCurrencyChoose from '@/component/fms/fms-currency-choose.vue'

import superTablePageFunction from '@/mixin/super-table-page-function';
let moduleName = "label_fms_bank_card_manage"

export default {

  title: moduleName,
  components: { FmsCurrencyChoose },
  mixins: [superTablePageFunction],
  data() {


    return {




      option: {
        search: {
          model: [
            { label: "label_fms_bank_card_keyword", key: "keyword", attrs: { clearable: true }, },
            {
              label: "label_fms_account_apply_status", key: "status", type: 'select', enum: 'IsAvailableStatusEnum', attrs: { clearable: true },
            }
          ],
        },
        action: [
          {
            label: 'label_fms_bank_card_add_bank', auth: 'fms_config_bank_card_edit', attrs: { icon: "el-icon-plus" }, click: () => {
              this['$refs']['formDialog'].showNew({
                title: this.$tt('label_fms_bank_card_add_bank'),
                data: {},
                onlySetData: true,
              })
            }
          },
        ],

        table: {
          url: "/fms-api/agent/AgentBankcardRpc/selectPage.json",
       
          model: [
            { key: 'subCompanyName', label: 'label_fms_bank_card_subsidiary', align: 'left' },
            { key: 'bankName', label: 'label_fms_bank_card_deposit_bank', align: 'left' },
            { key: 'bankCardNo', label: 'label_fms_bank_card_account', align: 'left' },
            { key: 'accountName', label: 'label_fms_bank_card_account_name', align: 'left' },
            { key: 'bankAddress', label: 'label_fms_bank_card_account_address', align: 'left' },
            {
              key: 'status', label: 'label_fms_account_apply_status',
              width: 120,
              render:(h,s)=>this.$renderText(h,s,{enum:"IsAvailableStatusEnum"})
            },
            {
              type: 'operate', width: 220,
              operate: [

                {
                  label: 'IsAvailableStatusEnum__DISABLED',
                  auth: 'fms_config_bank_card_disable',
                  buttonClass: "button_text_danger", confirmButtonType: 'danger',
                  type: "confirm-button", message: "label_fms_bank_card_confirm_forbidden", url: '/fms-api/agent/AgentBankcardRpc/disable.json',
                  if: (row) => { return row.status == 'ENABLE' },
                  params: (v) => { return { id: v.id } }, done: ['reload', 'tip'],
                },
                {
                  label: 'IsAvailableStatusEnum__ENABLE',
                  auth: 'fms_config_bank_card_disable',
                  buttonClass: "button_text_success", confirmButtonType: 'success',
                  type: "confirm-button", message: "label_fms_bank_card_confirm_enable", url: '/fms-api/agent/AgentBankcardRpc/enable.json',
                  if: (row) => { return row.status != 'ENABLE' },
                  params: (v) => { return { id: v.id } }, done: ['reload', 'tip']
                },
                {
                  label: 'label_edit',
                  auth: 'fms_config_bank_card_edit',

                  click: (row) => {
                    this['$refs']['formDialog'].showNew({
                      title: this.$t('label_fms_bank_card_manage') + ": " + row.bankCardNo,
                      data: _.clone(row),
                      onlySetData: true,
                    })
                  }
                },
                {
                  label: 'label_delete',
                  auth: 'fms_config_bank_card_delete',
                  buttonClass: "button_text_danger", confirmButtonType: 'danger',
                  type: "confirm-button", url: '/fms-api/agent/AgentBankcardRpc/remove.json', message: 'label_fms_bank_card_confirm_delete',
                  params: (v) => { return { id: v.id } }, done: ['reload', 'tip']
                }
              ],
            }
          ]
        }
      },
      dialog: {
        customClass: 'dialog_auto',
        submitUrl: '/fms-api/agent/AgentBankcardRpc/saveUpdate.json',
        form: {
          itemClass: "form_item_default", inputClass: "form_input_default",
          model: [
            { key: 'subCompanyName', label: 'label_fms_bank_card_subsidiary', },
            { key: 'currencyType', label: 'label_fms_bank_card_currency', type: FmsCurrencyChoose },
            { key: 'bankName', label: 'label_fms_bank_card_deposit_bank', },
            { key: 'bankCardNo', label: 'label_fms_bank_card_account', },
            { key: 'accountName', label: 'label_fms_bank_card_account_name', },
            { key: 'bankAddress', label: 'label_fms_bank_card_account_address', },


          ],
          rules: {
            'subCompanyName': [{ required: true, message: this.$tt('tip_can_no_empty'), trigger: 'change' }],
            'currencyType': [{ required: true, message: this.$tt('tip_can_no_empty'), trigger: 'change' }],
            'bankName': [{ required: true, message: this.$tt('tip_can_no_empty'), trigger: 'change' }],
            'bankCardNo': [{ required: true, message: this.$tt('tip_can_no_empty'), trigger: 'change' }],
            'accountName': [{ required: true, message: this.$tt('tip_can_no_empty'), trigger: 'change' }],
          },
        }
      },


    };
  },


  methods: {




  }
};

</script>
<style></style>
